widget: Always pass on baselines
authorTimm Bäder <mail@baedert.org>
Tue, 4 Jul 2017 17:00:00 +0000 (19:00 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 20 Jul 2017 01:27:15 +0000 (21:27 -0400)
gtk/gtksizerequest.c
gtk/gtkwidget.c

index 0b1564edebf414b1a84ae70cbc769e4e20c8c876..9d991b10d181e9ce1a3f5cd32d1a98b88b0d2bcd 100644 (file)
@@ -299,12 +299,6 @@ gtk_widget_query_size_for_orientation (GtkWidget        *widget,
              min_baseline = -1;
              nat_baseline = -1;
            }
-         else if (gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
-           {
-             /* Ignore requested baseline for non-aligned widgets */
-             min_baseline = -1;
-             nat_baseline = -1;
-           }
           else if (min_baseline > reported_min_size ||
                    nat_baseline > reported_nat_size ||
                    min_baseline < 0 ||
index 4cb273a23b8b5b2bbfac8b5687b1f8005672df04..ea95498b4ff013dad2b238f1278133bf57dff258 100644 (file)
@@ -3793,6 +3793,8 @@ gtk_widget_init (GTypeInstance *instance, gpointer g_class)
   priv->last_child = NULL;
   priv->prev_sibling = NULL;
   priv->next_sibling = NULL;
+  priv->allocated_baseline = -1;
+  priv->allocated_size_baseline = -1;
 
   priv->sensitive = TRUE;
   priv->redraw_on_alloc = TRUE;
@@ -5366,9 +5368,6 @@ invalidate:
  * margins, and applying the widget’s #GtkWidget:halign and
  * #GtkWidget:valign properties.
  *
- * If the child widget does not have a valign of %GTK_ALIGN_BASELINE the
- * baseline argument is ignored and -1 is used instead.
- *
  * Since: 3.10
  **/
 void
@@ -5436,12 +5435,6 @@ gtk_widget_size_allocate_with_baseline (GtkWidget     *widget,
     }
 #endif /* G_ENABLE_DEBUG */
 
-  /* Never pass a baseline to a child unless it requested it.
-     This means containers don't have to manually check for this. */
-  if (baseline != -1 &&
-      gtk_widget_get_valign (widget) != GTK_ALIGN_BASELINE)
-    baseline = -1;
-
   alloc_needed = priv->alloc_needed;
   /* Preserve request/allocate ordering */
   priv->alloc_needed = FALSE;